<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P52 【例3-2】demo02.html</title>
</head>

<body>
    <div class="nav" id="navlist"></div>
    <script>
        var varlist = ['首页', '免费资源', '课程中心', 'IT学院', '学员故事', '线上学院', '技术社区'];
        var str = '<ul>';
        for (var i in navlist) {
            str += '<li><a>' + navlist[i] + '</a></li>'
        }
        str += '</ul>';
        document.getElementById('navlist').innerHTML = str;
    </script>
    <a href="../首页/page03.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>